﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DriveBeamEditor.Controls.BeamNG.VehiclePartConfig;
using JBeamLibrary.VehicleParts.Collections;

namespace DriveBeamEditor.Controls.BeamNG.SectionControls
{
    public partial class TestNewNodes : VehiclePartControl
    {
        #region CTORs

        public TestNewNodes()
        {
            InitializeComponent();
        }

        #endregion

        #region Events

        #endregion

        #region Methods

        private void BindNodes()
        {
            grid.Enabled = false;
            bindingSourceNodes.DataSource = null;

            if (VehiclePart != null)
                bindingSourceNodes.DataSource = VehiclePart.NodeSection.ElementCollection;

            grid.Refresh();
            grid.Enabled = true;
        }

        protected override void OnVehiclePartChanged()
        {
            BindNodes();
            base.OnVehiclePartChanged();
        }

        #endregion
    }
}
